package com.ruoyi.activiti.controller;

import com.alibaba.fastjson2.JSON;
import com.ruoyi.activiti.entity.JobProcessQueryRequest;
import com.ruoyi.activiti.entity.JobProcessQueryResponse;
import com.ruoyi.activiti.service.IJobApprovalActiviti;
import com.ruoyi.common.core.domain.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/job/activit")
public class JobActivitiController {
    @Resource
    private IJobApprovalActiviti jobApprovalActiviti;

    @PostMapping("query/process")
    public AjaxResult queryProcess(JobProcessQueryRequest jobProcessQueryRequest) {
        JobProcessQueryResponse jobProcessQueryResponse = jobApprovalActiviti.queryProcess(jobProcessQueryRequest);
        log.info("查询Activiti 流程 参数:{} 结果:{}", JSON.toJSONString(jobProcessQueryRequest), JSON.toJSONString(jobProcessQueryResponse));
        return AjaxResult.success(jobProcessQueryResponse);
    }

}














